<template>
    <div>
        <!-- 头部部分 -->
    <header class="header">
      <h1>todos</h1>
      <input  v-model.trim="Totex"  @keydown.enter="add" class="new-todo" placeholder="请输入任务名称" autofocus />
    </header>
    </div>
</template>

<script>
export default {
    

    data() {
        return {
            Totex:''
        };
    },
    methods:{
        add(){
            if(this.Totex==='') return
            this.$emit('Tohead',this.Totex)
            this.Totex=''
        }
    }

   
};
</script>

<style lang="scss" scoped>

</style>